package com.qf.day05;

public class Cat {
    String breed;
    String color;
    int age;
    String name;
    String sex;
    int happyValue;
    double weight;

    public void eat() {
        System.out.println(name+"吃鱼");
    }
    public void sleep() {
        System.out.println(name+"睡觉");
    }
    public void getFish() {
        System.out.println(name+"抓鱼");
    }
    public void exclusive() {
        System.out.println(name+"后空翻");
    }
    public void swap(int[] arr ,int indexA , int indexB) {

        int tmp = arr[indexA];
        arr[indexA]= arr[indexB];
        arr[indexB] = tmp;

    }
    public void bubbleSort(int[] arr){
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-i-1; j++) {
                if(arr[j]>arr[j+1]){
                    //交换
                    this.swap(arr , j ,j+1);
                }
            }
        }
        System.out.println("冒泡排序");
    }

    public Cat() {
    }

    public Cat(String name) {
        this.name = name;
    }

    public Cat(String breed, String color, int age, String name, String sex, int happyValue, double weight) {
        this.breed = breed;
        this.color = color;
        this.age = age;
        this.name = name;
        this.sex = sex;
        this.happyValue = happyValue;
        this.weight = weight;
    }

    @Override
    public String toString() {
        return "Cat{" +
                "breed='" + breed + '\'' +
                ", color='" + color + '\'' +
                ", age=" + age +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", happyValue=" + happyValue +
                ", weight=" + weight +
                '}';
    }
}
